<?php if (!defined('THINK_PATH')) exit();?>
 <html>
<head>
<title><?php echo ($result["name"]); ?></title>
    <script src="/drclothes/Public/js/jquery.min.js"></script>    
    <script src="/drclothes/Public/js/bootstrap.min.js"></script>  
    <link href="/drclothes/Public/css/bootstrap.min.css" rel="stylesheet">
    <link href="/drclothes/Public/css/animate.min.css" rel="stylesheet">
    <link href="/drclothes/Public/css/style.css" rel="stylesheet">
</head>
<body>
    
<div class="container-fluid background9">
<div class="container">
    <div class="row clearfix">
        <div class="col-xs-12 column">
            <?php
 if(!isset($_SESSION['username'])){ echo'<h6><a href="/drclothes/index.php"  style="color:#999;"><font class="glyphicon glyphicon-home">首页</font></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <a href="/drclothes/index.php/home/form/login"  style="color:#999;"><font>登录</font></a>&nbsp;|&nbsp;
                        <a href="/drclothes/index.php/home/form/register"  style="color:#999;"><font>注册</font></a></h6>'; } else{ $username= $_SESSION['username']; $userrank= $_SESSION['userrank']; echo "<h6><font style='float:right;'>".$userrank."&nbsp;".$username."&nbsp;&nbsp;
                        <a href='/drclothes/index.php/home/form/logout' style='color:#999;'>退出</font>
                        <a href='/drclothes/index.php' style='color:#999;'><font class='glyphicon glyphicon-home'>首页</font></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        </h6>"; } ?>
        </div>
    </div>
</div>
</div>
<div class="container-fluid">
    <div class="container">
		<div class="row clearfix">
            <div class="col-xs-12 column" align="center">
                <img src="/drclothes/Public/image/logo.png" class="img-responsive margin15" />
            </div>
            <div class="col-xs-offset-4 col-xs-4 column" align="center" style="padding-top:13px;">
                <form role="search" class="form-horizontal" action="/drclothes/index.php/home/form/searchresult" method="get" style="margin-bottom:0px;">
                    <div class="input-group">
                        <input id="query" name="name" type="text" placeholder="搜索 商品..." class="form-control" required />
                        <span class="input-group-btn">
                            <button class="btn button2" type="submit" style="top:0px;">搜索</button>
                        </span>
                    </div>
                </form>
            </div>
		</div>
	</div>
</div>
<div class="container">
    <div class="row clearfix">
        <div class="col-xs-12 column padding3 padding1" align="center">
            <a href="/drclothes/index.php">首页</a>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/drclothes/index.php/home/form/searchresult?name=">全部</a>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/drclothes/index.php/home/form/searchresult?name=新">新款</a>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/drclothes/index.php/home/form/searchresult?name=促销">促销</a>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/drclothes/index.php/home/form/searchresult?name=男">男士</a>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/drclothes/index.php/home/form/searchresult?name=女">女士</a>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/drclothes/index.php/home/form/cart">购物车</a>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/drclothes/index.php/home/form/orderlist">订单</a>
        </div>       
    </div>
</div>


						<div class="container">
							<div class="row clearfix margin4">
								<div class="col-xs-6 column margin1 padding10">
									<form class="form-horizontal"  method="POST"  action="/drclothes/index.php/home/form/addcart">
										<fieldset>

										<!-- 表单名称 -->
										<div class="form-group">
										  <label class="col-xs-offset-3 col-xs-9  control-label" style="text-align:left;"><h4><b><?php echo ($result["name"]); ?></b></h4></label>
										</div>	
										<div class="form-group">
										  <label class="col-xs-offset-3 col-xs-9" style="font-weight: 300;margin-bottom:0px;">price</label>
										  <label class="col-xs-offset-3 col-xs-9  control-label" style="text-align:left;">￥<?php echo ($result["price"]); ?></label>
										  <input type="hidden" id="danjia" class="form-control" name="price" value="<?php echo ($result["price"]); ?>">
										</div>
										<div class="form-group">
										  <label class="col-xs-offset-3 col-xs-9" style="font-weight: 300;margin-bottom:0px;">description</label>
										  <label class="col-xs-offset-3 col-xs-9  control-label" style="text-align:left;"><?php echo ($result["description"]); ?></label>
										</div>
										<div class="form-group">
										  <label class="col-xs-offset-3 col-xs-9" style="font-weight: 300;margin-bottom:0px;">size</label>
										  <div class="col-xs-offset-3 col-xs-4" style="text-align:left;">
										  	<select id="size" name="size" class="form-control">
										      <option value="xs">xs</option>
										      <option value="s">s</option>
										      <option value="m">m</option>
										      <option value="xs">l</option>
										      <option value="s">xl</option>
										      <option value="m">xll</option>
										    </select></div>
										</div>
										<div class="form-group">
										  <label class="col-xs-offset-3 col-xs-9" style="font-weight: 300;margin-bottom:0px;">number</label>
										    <div class="col-xs-offset-3 col-xs-4">
												<div class="input-group">
													<span class="input-group-btn">
															<button type="button" class="btn button2 btn-number"  data-type="minus" data-field="number" style="padding-top: 9px;padding-bottom: 9px;">
																	<span class="glyphicon glyphicon-minus"></span>
															</button>
													</span>
													<input type="text" name="number" id="number" class="form-control input-number" value="1" min="1" max="100">
													<span class="input-group-btn">
															<button type="button" class="btn button2 btn-number" data-type="plus" data-field="number"  style="padding-top: 9px;padding-bottom: 9px;">
																	<span class="glyphicon glyphicon-plus"></span>
															</button>
													</span>
											</div>

											</div>
										</div>
										<div class="form-group">
										  <label class="col-xs-offset-3 col-xs-9" style="font-weight: 300;margin-bottom:0px;">total price</label>
										  <label class="col-xs-offset-3 col-xs-9 control-label" style="text-align:left;" id="zongjia"></label>
										</div>
										<?php
 if(!isset($_SESSION['username'])){ echo'
										<!-- 按钮 -->
										<div class="form-group">
										  <label class="col-xs-3 control-label" for="singlebutton">提交</label>
										  <div class="col-xs-9">
										    <a href="/drclothes/index.php/home/form/login"><input id="singlebutton" name="singlebutton" class="btn btn-primary" value="请登录后购买"></a>
										  </div>
										</div>'; } else{ echo'<input type="hidden" id="drclothesid" class="form-control" name="drclothesid" value="'.$result['id'].'">
											<input type="hidden" id="username" class="form-control" name="username" value="'.$_SESSION['username'].'">
											<input type="hidden" id="img" class="form-control" name="img" value="'.$result['img'].'">
											<input type="hidden" id="name" class="form-control" name="name" value="'.$result['name'].'">
											<input type="hidden" id="price" class="form-control" name="price" value="'.$result['price'].'">
										<!-- 按钮 -->
										<div class="form-group">
										  <label class="col-xs-3 control-label" for="singlebutton"></label>
										  <div class="col-xs-9">
										    <input id="singlebutton" type="submit" name="singlebutton" class="btn btn-primary button2"  value="购买">
										  </div>
										</div>'; }?>
										</fieldset>
									</form>
								</div>
								<div class="col-xs-6 column padding1" align="center">
									<img src="/drclothes/Public/<?php echo ($result["img"]); ?>" class="img-responsive ">
								</div>
							</div>
						</div>
 
<div class="container">
    <div class="row clearfix">
        <div class="col-xs-12 column margin1 padding1">
            <form class="form-horizontal">
                <fieldset>
                <!-- 表单名称 -->
                <legend class="text-center">评论列表</legend>
                <?php if(is_array($comment)): $k = 0; $__LIST__ = $comment;if( count($__LIST__)==0 ) : echo "$empty" ;else: foreach($__LIST__ as $key=>$commentitem): $mod = ($k % 2 );++$k;?><div class="panel panel-default">
                    <div class="panel-heading" style="background-color: #333;">
                        <h3 class="panel-title" style="color:#fff;"><font style="float:right;"><?php echo ($commentitem["addtime"]); ?></font><font class="glyphicon glyphicon-user"><?php echo ($commentitem["username"]); ?></font></h3>
                    </div>
                    <div class="panel-body">
                        <?php echo ($commentitem["comment"]); ?>
                    </div>
                </div><?php endforeach; endif; else: echo "$empty" ;endif; ?>
                </fieldset>
            </form>
        </div>
        <div class="col-xs-12 column margin1 padding1" align="center">
            <form class="form-horizontal"  method="POST"  action="/drclothes/index.php/home/form/addcomment">
                <fieldset>

                <!-- 表单名称 -->
                <legend>发表评论</legend>
                <?php
 if(!isset($_SESSION['username'])){ echo'<p>请先登录</p>';} else{ echo'<input type="hidden" id="drclothesid" class="form-control" name="drclothesid" value="'.$result['id'].'">
                <input type="hidden" id="username" class="form-control" name="username" value="'.$_SESSION['username'].'">
                <div class="form-group">
                <textarea class="form-control" rows="3" name="comment" placeholder="说点什么..."></textarea>
                </div>
                <div class="form-group">
                    <label class="col-md-4 control-label" for="singlebutton"></label>
                    <div class="col-md-4">
                    <input id="singlebutton" type="submit" class="btn btn-primary button2" value="提交评论">
                    </div>
                </div>
                ';} ?>
                </fieldset>
            </form>
        </div>
    </div>
</div>


<div class="container-fluid">
<div class="container">
	<div class="row clearfix" align="center">
			<div class="col-xs-12 column color1 padding3">
		       	<img alt="" src="/drclothes/Public/image/logo.png" class="img-responsive" />
		    </div>
			<h5 style="margin-top:140px;">Drclothes 辽ICP备123456789号</h5>
		</div>
	</div>
</div>	
</div>
</body>
</html>
<script src="/drclothes/Public/js/btn-number.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$("#zongjia").html("￥<?php echo ($result["price"]); ?>");
    $("#number").change(function() {
    	var val = document.getElementById("number").value;
    	var danjia = document.getElementById("danjia").value;
    	$("#zongjia").html(val*danjia);
    });
})
</script>